<?php
class administrators extends Model {

    function administrators() {
        parent::Model();
    }

    function checkAdmin($user, $pass) {
        $username=mysql_real_escape_string($user);
        $userpass=md5($pass);

        $this->db->select('*');
        $this->db->from('administrators');
        $this->db->where('admin_login', $username);
        $this->db->where('admin_pass', $userpass);
        $query = $this->db->get();
        $result =  $query->result();
        if(sizeof($result)==1) {
            return $result;
        }else {
            return false;
        }
    }
}
?>
